<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 任宝顺
  Date: 2022/2/22
  Time: 20:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <meta charset="UTF-8">
  <title>修改手机</title>
  <link rel="stylesheet" type="text/css" href="css/adduser.css"/>
</head>
<body>
<div class="bg">
  <div class="logo lfet"></div>
  <div class="font lfet">
    修改手机>>>
  </div>
  <div class="wizard right">
    <form action="${pageContext.request.contextPath}/UpdatePhoneController" method="post">
      <div class="content">
        <div class="col">
          <div class="form-group">
            <label class="lfet">手机编号:</label>
            <input name="pid" type="text" class="form-control error inp-bg1 left" value="${requestScope.phone.pid}" style="outline:none;">
          </div>
          <div class="form-group">
            <label class="lfet">手机名称:</label>
            <input name="pname" type="text" class="form-control error inp-bg1 left" value="${requestScope.phone.pname}" style="outline:none;">
          </div>
          <div class="form-group">
            <label style="text-align: left;">是否有货:</label>
            <input type="radio" style="outline:none;" name="state" value="1"
            <c:if test="${requestScope.phone.state==1}">
                   checked="checked"
            </c:if>
            /><span>有货</span>
            <input type="radio" style="outline:none;" name="state" value="0"
            <c:if test="${requestScope.phone.state==0}">
                   checked="checked"
            </c:if>
            ><span>无货</span>
          </div>
          <div class="form-group">
            <label class="lfet">价格:</label>
            <input type="text" name="price" value="${requestScope.phone.price}" class="form-control error dh" style="outline:none;">
          </div>
          <div class="form-group">
            <label class="lfet">品牌:</label>
            <select   name="brandId" class="form-control error map" style="outline:none;height: 30px;width: 300px;" >
              <c:forEach items="${requestScope.map}" var="entry">
                <option value="${entry.key}"
                        <c:if test="${entry.key == requestScope.phone.brandId}">
                                selected="selected"
                        </c:if>
                        >${entry.value}
                </option>
              </c:forEach>
            </select>
          </div>
          <div class="bottom" style="text-align: center;">
            <!-- 这个button也可以提交表单，不需要改成submit -->
            <button style="text-align: center;">提 交</button>
          </div>
        </div>
      </div>
    </form>
  </div>
</div>
</body>
</html>
